# -*- coding: utf-8 -*-
"""
Created on Tue May 13 09:38:50 2025
求空间任意三点连接而成的面积
@author: Bradley
"""
import numpy as np
A=np.array([1,1,1])
B=np.array([3,1.5,1.5])
C=np.array([4,2,2])
Dab=np.sqrt(np.sum((A-B)**2))
Dac=np.sqrt(np.sum((A-C)**2))
Dbc=np.sqrt(np.sum((B-C)**2))
print('AB长度为，',Dab)
print('AC长度为，',Dac)
print('BC长度为，',Dbc)
s=(Dab+Dac+Dbc)/2
area=np.sqrt(s*(s-Dab)*(s-Dac)*(s-Dbc))
print('该任意三角形的面积为；%.2f平方米'%(area))
